<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>币拍</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">

    <link rel="stylesheet" href="plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="css/global.css" media="all">
    <link rel="stylesheet" href="plugins/font-awesome/css/font-awesome.min.css">
</head>
<body>
<div class="layui-container" style="width: 80%">
    <form class="layui-form">
        <div class="layui-row" style="margin-top: 50px">
            <fieldset class="layui-elem-field" style="margin-top: 20px">
                <legend style="font-weight: bold;font-size: 40px">节点信息</legend>
                <div class="layui-col-md12" style="font-size: 25px">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label" style="width:400px">
                                server_version：
                            </label>
                            <div class="layui-input-inline" style="width: 500px;">
                                <input name="server_version" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label" style="width:400px">
                                head_block_num：
                            </label>
                            <div class="layui-input-inline" style="width: 500px;">
                                <input name="head_block_num" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label" style="width:400px">
                                last_irreversible_block_num：
                            </label>
                            <div class="layui-input-inline" style="width: 500px;">
                                <input name="last_irreversible_block_num" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label" style="width:400px">
                                head_block_id：
                            </label>
                            <div class="layui-input-inline" style="width: 500px;">
                                <input name="head_block_id" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label" style="width:400px">
                                head_block_time：
                            </label>
                            <div class="layui-input-inline" style="width: 500px;">
                                <input name="head_block_time" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label" style="width:400px">
                                head_block_producer：
                            </label>
                            <div class="layui-input-inline" style="width: 500px;">
                                <input name="head_block_producer" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label" style="width:400px">
                                recent_slots：
                            </label>
                            <div class="layui-input-inline" style="width: 500px;">
                                <input name="recent_slots" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label" style="width:400px">
                                participation_rate：
                            </label>
                            <div class="layui-input-inline" style="width: 500px;">
                                <input name="participation_rate" class="layui-input">
                            </div>
                        </div>
                    </div>
                </div>
            </fieldset>
        </div>
    </form>
</div>
<script type="text/javascript" src="./js/config.js"></script>
<script type="text/javascript" src="plugins/layui/layui.js"></script>
<script type="text/javascript">
    layui.use(['table','jquery','element'],function (){
        var $ = layui.$;
        var table = layui.table;
        var element = layui.element;

        $.ajax({
            url: contextPath+"chain/info",
            type: "GET",
            contentType:"application/json;charset=utf-8",
            dataType:"json",
            success:function (data) {
                $('input[name="server_version"]').attr("value",data.server_version);
                $('input[name="head_block_num"]').attr("value",data.head_block_num);
                $('input[name="last_irreversible_block_num"]').attr("value",data.last_irreversible_block_num);
                $('input[name="head_block_id"]').attr("value",data.head_block_id);
                $('input[name="head_block_time"]').attr("value",data.head_block_time);
                $('input[name="head_block_producer"]').attr("value",data.head_block_producer);
                $('input[name="recent_slots"]').attr("value",data.recent_slots);
                $('input[name="participation_rate"]').attr("value",data.participation_rate);
            },
            error:function () {
            }
        });

    });
</script>
</body>
</html>